<template>
  <div class="uploadPage">
    <van-nav-bar title="已保存视频目录" left-text="返回" left-arrow fixed @click-left="onClickLeft" />

        <!-- <div v-for="(item,index) in this.saveData" :key="index"> -->
            <van-panel title="西游记" desc="总共53集/已上传5集" status="待上传" @click="goUpVideo()" >
                  <template #footer class="uploadPage_btn"> 
                  <van-button type="primary" size="large"   @click="DeleteParentFileInfo()">删除全部剧集</van-button>
                </template>
            </van-panel>
        <!-- </div> -->
  </div>
</template>

<script>

export default {
  
  data() {
    return {
      tel: "",
      text: "",
      digit: "",
      number: "",
      password: ""
    };
  },
  
  methods: {  
    //跳转到内页
    onClickLeft() {
      this.$router.go(-1);
    },
    //跳去已经上传视频详细页面
    goUpVideo(){
      
    },
    //获取已经保存的信息
    GetSaveFileInfo() {
      this.$axios({
        method: "get",
        url: "/api/User/GetSaveFileInfo",
        params: {
          fileid: 0
        }
      })
        .then(res => {
          // debugger
          if (res.data.code === 0) {
            // debugger
            console.log(res.data.data);
            // this.saveData = res.data.data
            //  this.images = res.data.data;
            //  console.log(this.images);
            // this.$toast({
            //   duration: 800,
            //   message: "数据已删除"
            // });
          }
          if (res.data.Code == 1) {
            this.$toast({
              duration: 800,
              message: res.data.Message
            });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    //删除整部剧
    DeleteParentFileInfo() {
      const id = '父id'
      this.$axios({
        method: "post",
        url: "/api/User/DeleteParentFileInfo",
        data:id
      })
        .then(res => {
          if (res.data.code === 0) {
            console.log(res.data.data);
            //  this.images = res.data.data;
            //  console.log(this.images);
            // this.$toast({
            //   duration: 800,
            //   message: "数据已删除"
            // });
          }
          if (res.data.code == 1) {
              this.$toast({
                duration: 800,
                message: res.data.message
              });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    //删除多个或一个文件信息
    DeleteFileInfo() {
      const ids = '父id'
      this.$axios({
        method: "post",
        url: "/api/User/DeleteFileInfo",
        data:ids
      })
        .then(res => {
          if (res.data.code === 0) {
            console.log(res.data.data);
            //  this.images = res.data.data;
            //  console.log(this.images);
            // this.$toast({
            //   duration: 800,
            //   message: "数据已删除"
            // });
          }
          if (res.data.code == 1) {
              this.$toast({
                duration: 800,
                message: res.data.message
              });
          }
        })
        .catch(err => {
          console.log(err);
        });
    }
  },

  created() {
    this.GetSaveFileInfo();
    this.$emit("header", false);
    this.$emit("footer", false);
  },
  //
  mounted() {}
};
</script>

<style lang="less" scoped>

.ImforL-Note {
  background-color: #fff;
}
.moticelist {
  margin-top: 10px;
}

.ImforL-Note span {
  display: block;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 30px;
  //   padding: 10px;
}
.item-notes {
  font-size: 16x;
  text-align: left;
  margin: 20px;
  padding-bottom: 50px;
  line-height: 20px;
}
.title {
  font-size: 14x;
  text-align: center;
  margin: 20px;
  padding-top: 100px;
}

.uploadImage {
  span {
    font-size: 15px;
    margin-right: 20px;
    margin-left: 20px;
  }
}
.basicImfor {
  margin-top: 10px;
}
.uploadVideo {
  margin-top: 10px;
}
.panelDIV {
  // font-size: 12px;
  margin-top: 10px;
}
.vanpanel{
  height: 40px;
  span{
    font-size: 12px;
    margin-left: 20px;
    margin-right: 20px;
  }
  .DELbtn{
    // text-align: end;
    float: right;
    margin-right: 10px;
  }
}

.uploadbtn{
  margin-right: 20px;
}
</style>


